import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:winkai/res/app_colors.dart';
import 'package:winkai/res/dimens.dart';
import 'package:winkai/utils/image_utils.dart';

class NormalActionWidget extends StatelessWidget {
  const NormalActionWidget({
    super.key,
    required this.actionName,
    this.rightTips,
    this.onTap,
    this.onLongPress,
  });

  final GestureTapCallback? onTap;
  final GestureTapCallback? onLongPress;
  final String actionName;
  final String? rightTips;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      onLongPress: onLongPress,
      behavior: HitTestBehavior.translucent,
      child: Container(
        width: double.infinity,
        height: 50.w,
        alignment: Alignment.center,
        padding: EdgeInsets.symmetric(horizontal: Dimens.mainHorizontalSpacing),
        child: Row(
          children: [
            Expanded(
              child: Text(
                actionName,
                style: TextStyle(
                  fontSize: 14.sp,
                  fontWeight: FontWeight.w500,
                  color: Colors.black,
                ),
              ),
            ),
            if (rightTips?.isNotEmpty == true)
              Padding(
                padding: EdgeInsets.symmetric(horizontal: 4.w),
                child: Text(
                  rightTips!,
                  style: TextStyle(
                    fontSize: 14.sp,
                    fontWeight: FontWeight.w500,
                    color: AppColors.color_80,
                  ),
                ),
              ),
            ImageUtils.getImage('ic_ai_arrow_black', 20.w, 20.w),
          ],
        ),
      ),
    );
  }
}
